close all; clear; clc;
A=imread('autumn.tif');
A_gray=rgb2gray(A);
C=dct2(A_gray);
C(abs(C)<10)=0;
D=idct2(C);
%%
subplot(221),imshow(A),     title('原图')
subplot(222),imshow(A_gray),title('灰度图')
subplot(223),imshow(C),     title('灰度图的余弦变换图')
subplot(224),imshow(D,[]),  title('反变换效果图')